#include<iostream>
using namespace std;
#include<vector>
class Solution {
public:
    int mySqrt(int x) {
        if (x < 1)
            return 0;
        int left = 0;
        int right = x;
        while (left < right) {
            long long mid = left + (right - left) / 2 + 1;
            if (mid * mid > x)
                right = mid - 1;
            else
                left = mid;
        }
        return left;
    }
};
int main()
{
    int x;
    cin >> x;
    Solution s;
    cout << s.mySqrt(x) << endl;
    return 0;
}